 <link href="<?= STATICURL; ?>css/bootstrap.min.css" rel="stylesheet" />
    <link id="bootstrap-rtl-link" href="" rel="stylesheet" />
    <link href="<?= STATICURL; ?>css/font-awesome.min.css" rel="stylesheet" />
    <link href="<?= STATICURL; ?>css/weather-icons.min.css" rel="stylesheet" />
    <!--Fonts-->
    <!--Beyond styles-->
    <link id="beyond-link" href="<?= STATICURL; ?>css/beyond.min.css" rel="stylesheet" type="text/css" />
    <link href="<?= STATICURL; ?>css/demo.min.css" rel="stylesheet" />
    <link href="<?= STATICURL; ?>css/typicons.min.css" rel="stylesheet" />
    <link href="<?= STATICURL; ?>css/animate.min.css" rel="stylesheet" />
    <link id="skin-link" href="" rel="stylesheet" type="text/css" />
    <div class="page-content">
        <div class="page-body">
            <div id="horizontal-form">
                    <form class="form-horizontal" role="form">
                        <div class="row">
                            <div class="col-md-7">
                                <input class="form-control js_name" type="text" placeholder="请输入分类名称">
                                <div class="horizontal-space"></div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-7">
                                <input placeholder="排序 默认0" class="form-control js_order" type="text" value="0" />
                                <div class="horizontal-space"></div>
                            </div>
                        </div>
                        
                        <div class="widget-content" style="float: right">
                            <ul class="thumbnails picList">
                           
                            </ul>
                        </div>
                        <div class="horizontal-space"></div>
                        <div style="clear:both;">
                            <span id="js_submit" class="btn btn-default">提交</span>
                        </div>
                    </form>
                </div>
        </div>
        <input type="hidden" id="idpalce" value="<?php echo $AdInfo['id']?>" />
<script src="<?php echo STATICURL; ?>js/jquery-2.0.3.min.js"></script>
<script src="<?php echo STATICURL; ?>js/bootstrap.min.js"></script>
<script src="<?php echo STATICURL; ?>layer/layer.js"></script>
<script src="<?php echo STATICURL; ?>js/swfupload.js"></script>
<script src="<?php echo STATICURL; ?>js/swfupload.queue.js"></script>
<script src="<?php echo STATICURL; ?>js/fileprogress.js"></script>
<script src="<?php echo STATICURL; ?>js/handlers.js"></script>
<?php require_once ADMINVIEWPATH.'admin_footer.php'; ?>

<script>
    $(document).ready(function(){
        
        $(".js_order").bind({
                keyup:function(){
                     var txt = $('.js_order').val();
                     var reg = /^[\d]+$/;
                     if(!reg.test(txt) ){
                            $(this).val(0);
                     }
                },
                focus:function(){
                    if ($(this).val() == 0){
                        $(this).val('');
                    }
                },
                blur:function(){
                    if ($(this).val() == ''){
                        $(this).val(0);
                    }
                }
        });        

        $("#js_submit").click(function(){
            if ($(".js_name").val() == ""){
                layer.msg("请输入分类名称");
                $(".js_name").focus();
                return;
            }
            $.post("/luckydog/newscategory/do_add", {cat_name:$(".js_name").val(),sort_order:$(".js_order").val()}, function(data) {
                console.log(data);
                if (data.status) {
                    layer.msg(data.message);
                    window.parent.location.reload();
                }else{
                    layer.msg(data.message);
                }
            }, "json");
        });     
    });
</script>


